package cn.bitkit.base.util;

import java.util.Arrays;
import java.util.StringJoiner;

public class PathUtil {

    public static String asPath(String... paths){
        StringJoiner joiner = new StringJoiner("/", "", "/");
        Arrays.asList(paths).forEach(path -> {
            if(StringUtil.hasValue(path)){
                joiner.add(path.strip().replaceAll("\\\\", "/").replaceAll("^/+|/+$", ""));
            }
        });
        return joiner.toString();
    }

}
